JavaScript

A5.audio.RecordergetState Method

Syntax

A5.audio.Recorder.getState()

Returns

stateobject

The state object of the A5.audio.Recorder. See A5.audio.Recorder properties for contents of state.

Description

Refresh and return the state of the A5.audio.Recorder.

Example: Getting State Information for the AudioRecorderAndPlayer Control

The UX Component AudioRecorderAndPlayer control's JavaScript object can be used to get the recorder state object, which contains information such as whether or not the recorder is actively recording or the maximum length supported for an audio recording. The _rec property of the object contains the audio recorder class methods. The JavaScript below demonstrates how to get the recorder state object for an AudioRecorderAndPlayer control and display its contents in a popup message:

// Get the JavaScript object for the AudioRecorderAndPlayer Control
var audioObj = {dialog.object}.getControl("AUDIORECORDERANDPLAYER");

if (audioObj) {
    // Get the recorder state information:
    var audioStateObj = audioObj._rec.getState();

    // Display the state info in an alert:
    alert(JSON.stringify(audioStateObj));
}

See Also